package flink.api_study.simple;

import org.apache.flink.api.java.operators.DataSource;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class SimpleTest {
    public static void main(String[] args) throws Exception{
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStreamSource<Integer> stream = env.fromElements(1,2,3,4,5,6,7,8,9,10);
        stream.map(number->{
            System.out.println(Thread.currentThread().getName());
            return 2*number;
        })
        .print();
        env.execute();
    }
}
